<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class BrandsResource extends JsonResource
{
    public function toArray($request)
    {
    	$data = $this->resource;
    	
        return [
        	'id' => (int)$data->id,
	        'parent_id' => (int)$data->parent_id,
	        'name' => $data->name,
	        'name_mini' => $data->name_mini,
	        'image' => img_path($data->image),
	        'created_at' => (string)$data->created_at
        ];
    }
}
